<template>
  <!-- v-bind https://v3.cn.vuejs.org/api/instance-properties.html#attrs -->
  <div>
    <el-dropdown
      v-bind="$attrs"
      trigger="click"
      class="theme"
      @command="handeSetTheme"
    >
    <!-- 图标 -->
    <div>
      <el-tooltip content="变更主题">
        <svg-icon icon="change-theme"></svg-icon>
      </el-tooltip>
    </div>
    <!-- menu -->
    <template #dropdown>
      <el-dropdown-menu command="color">
        <el-dropdown-item>
          主题颜色切换
        </el-dropdown-item>
      </el-dropdown-menu>
    </template>
    </el-dropdown>
    <!-- 弹出层 -->
    <div>
      <select-color v-model="selectColorVisiable"></select-color>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import SelectColor from './components/SelectColor.vue'
const handeSetTheme = command => {
  selectColorVisiable.value = !selectColorVisiable.value
}
// dialog
const selectColorVisiable = ref(false)
</script>

<style lang="scss" scoped>

</style>
